﻿using ReflectionStudio.Core.Events;
using System;
using System.Data;
using System.Windows;
using System.Windows.Data;
using System.ComponentModel;
namespace WPFExcelReport
{
    public partial class K9343
    {
        public K9343()
        {
            if (DesignerProperties.GetIsInDesignMode(this))
                return;
            InitializeComponent();
            SDSA = "9343";
        }
        public override void LOADALL()
        {
            base.LOADALL();
            foreach (DataRow row in TBMain.Rows)
            {
                row["SDES"] = Helpers.Helper.Convert8859P1ToGB2312(row["SDES"].ToString().Trim());
                row["DES"] = Helpers.Helper.Convert8859P1ToGB2312(row["DES"].ToString().Trim());
            }
            if (SDSA.Length == 0) return;
            if (TBMain.Rows.Count > 0)
                return;
            if (DBSDDAT.ContainsKey(SDSA))
            {
                DBSDDAT.Remove(SDSA);
            }
            dwData = TBMain.NewRow();
            TMV.SetUpNewRow(ref dwData, SDSA);
            dwData["KEY"] = Helpers.Helper.ConvertGB2312To8859P1("P");
            dwData["DES"] = Helpers.Helper.ConvertGB2312To8859P1("程序控制");
            dwData["SDES"] = Helpers.Helper.ConvertGB2312To8859P1("程序控制");
            dwData["VALUE"] = Helpers.Helper.ConvertGB2312To8859P1("000000000");
            TMV.Save(dwData);
            dwData["KEY"] = Helpers.Helper.ConvertGB2312To8859P1("R");
            dwData["DES"] = Helpers.Helper.ConvertGB2312To8859P1("配方");
            dwData["SDES"] = Helpers.Helper.ConvertGB2312To8859P1("配方");
            dwData["VALUE"] = Helpers.Helper.ConvertGB2312To8859P1("000000000");

            TMV.Save(dwData);
            dwData["KEY"] = Helpers.Helper.ConvertGB2312To8859P1("S");
            dwData["DES"] = Helpers.Helper.ConvertGB2312To8859P1("开关");
            dwData["SDES"] = Helpers.Helper.ConvertGB2312To8859P1("开关");
            dwData["VALUE"] = Helpers.Helper.ConvertGB2312To8859P1("000000000");
            TMV.Save(dwData);
            dwData["KEY"] = Helpers.Helper.ConvertGB2312To8859P1("W");
            dwData["DES"] = Helpers.Helper.ConvertGB2312To8859P1("品种相关");
            dwData["SDES"] = Helpers.Helper.ConvertGB2312To8859P1("品种相关");
            dwData["VALUE"] = Helpers.Helper.ConvertGB2312To8859P1("000000000");
            TMV.Save(dwData);
            dwData["KEY"] = Helpers.Helper.ConvertGB2312To8859P1("E");
            dwData["DES"] = Helpers.Helper.ConvertGB2312To8859P1("位置");
            dwData["SDES"] = Helpers.Helper.ConvertGB2312To8859P1("位置");
            dwData["VALUE"] = Helpers.Helper.ConvertGB2312To8859P1("000000000");
            TMV.Save(dwData);
            dwData["KEY"] = Helpers.Helper.ConvertGB2312To8859P1("A");
            dwData["DES"] = Helpers.Helper.ConvertGB2312To8859P1("参考");
            dwData["SDES"] = Helpers.Helper.ConvertGB2312To8859P1("参考");
            dwData["VALUE"] = Helpers.Helper.ConvertGB2312To8859P1("000000000");
            TMV.Save(dwData);
            LOADALL();
        }
    }
}
